#include "topmenuadmin.h"
#include "ui_topmenuadmin.h"

#include "singletonroot.h"

#include <QList>


TopMenuAdmin::TopMenuAdmin(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TopMenuAdmin)
{
    ui->setupUi(this);
    QList<QPair<QRadioButton*,QString>> info;

    info.append({ui->radioButton_2,DK_AD_StudentMgrList});
    info.append({ui->radioButton_3,DK_ST_OneStudentInfo});
    info.append({ui->radioButton_4,DK_AD_userMgrList});
    info.append({ui->radioButton_5,DK_AD_CourseMgrList});
    info.append({ui->radioButton_6,DK_AD_ClassMgrList});
    info.append({ui->radioButton_7,DK_AD_ProfessionalsMgrLisr});

    for(auto &&item : info){
        connect(item.first,&QRadioButton::clicked,[=](){
            PAGEJUMP->setPage(item.second);
        });
    }
}

TopMenuAdmin::~TopMenuAdmin()
{
    delete ui;
}

void TopMenuAdmin::showEvent(QShowEvent *event)
{
    ui->radioButton_2->setChecked(true);
}


